<style lang="less">
@import './login.less';
</style>

<template>
	<div class="login">
		<div class="loginLeft">
			<img src="../../assets/images/logo.png" width="110" alt="logo" style="vertical-align: middle; text-align: center;">
		</div>
		<div class="login-con">
			<div style="margin-bottom:60px;text-align:center;"><img src="../../assets/images/logo1.png" /></div>
			<div class="form-con"><login-form @on-success-valid="handleSubmit"></login-form></div>
		</div>
	</div>
</template>

<script>
import LoginForm from '_c/login-form';
import { mapActions } from 'vuex';
export default {
	components: {
		LoginForm
	},
	methods: {
		...mapActions(['handleLogin', 'getUserInfo']),
		handleSubmit({ userName, password }) {
			this.handleLogin({ userName, password }).then(res => {
				this.getUserInfo().then(res => {
					this.$router.push({
						name: this.$config.homeName
					});
				});
			});
		}
	}
};
</script>

<style lang="less" scoped>
.loginLeft{
	position: relative;
	top: 50px;
	left: 70px;
}
</style>
